﻿using System;
using System.Collections.Generic;
using viNews.Classes;
using viNews.Controllers;
using visinia.SmartEngine.Modules;

public partial class Modules_viNews_NewsBoxes_NewsBoxes : WebModule
{
    protected void Page_Load(object sender, EventArgs e)
    {
        List<News> list = DataFilterController.GetFilteredData(ModuleId);
        if (list == null)
            return;
        NewsList.DataSource = list;
        NewsList.DataBind();
    }

    public string TrimSummary(string summary)
    {
        if (summary.Length > 150)
            return summary.Remove(150) + "...";
        return summary;
    }
}
